package Month07.day31;

import java.io.File;

public class DemoTest2 {
    public static void main(String[] args) {
        File file = new File("D:\\Idea-Project\\basic\\basic\\aaa");
        delteAll(file);
    }

    private static void delteAll(File file) {
        File[] files = file.listFiles();
        if (files !=null){
            for ( File path:files){
                if (path.isFile()){
                    path.delete();
                }else {
                    delteAll(path);
                }
            }
        }
        file.delete();
    }
}
